@extends('common.admin_template')

@section('content')
    <div class="boxWidth">
        <h3>表单详情</h3>
        @include('common.notice_msg')
        <?php $metaName = ['未','已'];$statusName = ['未付款','已付款','已取消']; ?>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">订单号</div>
            <div class="col-xs-6 formBorder">{{$order->trade}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">订单内容</div>
            <div class="col-xs-6 formBorder">{{$order->body}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">价格</div>
            <div class="col-xs-6 formBorder">实付：{{$order->total.'  '}}  总价：{{$order->content->total->max.'  '}}  优惠：{{$order->content->total->coupon.'  '}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">购买者</div>
            <div class="col-xs-6 formBorder">{{$order->user}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">状态</div>
            <div class="col-xs-6 formBorder">{{$statusName[$order->status]}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">配送</div>
            <div class="col-xs-6 formBorder">{{$metaName[$order->meta]}}配送</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">下单时间</div>
            <div class="col-xs-6 formBorder">{{$order->created_at}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">微信支付单号</div>
            <div class="col-xs-6 formBorder">{{$order->transaction}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c"></div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">地址详情</div>
            <div class="col-xs-6 formBorder">
                姓名：{{$order->content->address->name.'  '}}
                电话：{{$order->content->address->phone.'  '}}
                地址：{{$order->content->address->address.'  '}}
            </div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">店铺优惠</div>
            <div class="col-xs-6 formBorder">快递费：{{$order->content->shopInfo->delivery.'  '}}优惠：{{$order->content->shopInfo->full?'满'.$order->content->shopInfo->full.'减'.$order->content->shopInfo->cut:'无'}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">优惠券</div>
            <div class="col-xs-6 formBorder">
                <?php
                    if(!$order->content->coupon){
                        echo '无';
                    }else{
                        if($order->content->coupon->cat=='cut'){
                            echo '满'.$order->content->coupon->content->full.'减'.$order->content->coupon->content->cut;
                        }else if($order->content->coupon->cat=='cash'){
                            echo '抵扣'.$order->content->coupon->content.'元';
                        }else if($order->content->coupon->cat=='discount'){
                            echo $order->content->coupon->content?'原价'.$order->content->coupon->content.'%':'全额抵扣';
                        }
                    }
                ?>
            </div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">买家留言</div>
            <div class="col-xs-6 formBorder">{{isset($order->content->note)&&$order->content->note?$order->content->note:'无'}}</div>
            <div class="col-xs-1"></div>
        </div>
        <div class="row editFormItem t_c">
            <div class="col-xs-1"></div>
            <div class="col-xs-4 formBorderLeft">订单详情</div>
            <div class="col-xs-6 formBorder" style="height:auto">
                <ul>
                    <?php $i =0;?>
                    @foreach($order->content->list->item as $item)
                        <li>{{$item->name.'(价格：'.$item->price.') x'.$order->content->list->num[$i]}}</li>
                        <?php $i++; ?>
                    @endforeach
                </ul>
            </div>
            <div class="col-xs-1"></div>
        </div>
    </div>
@stop
@section('js')
    <script>
    </script>
@stop